/*
 * @Descripttion: 
 * @version: 
 * @Author: ada.wu
 * @Date: 2024-01-05 10:17:42
 * @LastEditors: ada.wu
 * @LastEditTime: 2024-04-10 09:54:14
 */
import { Module } from 'vuex';
import { RootStateTypes, VehicleState } from '../interface';
import { examList, examDetail,activityDetail ,examAnswerDetail} from "/@/api/ExamApi";

const module: Module<VehicleState, RootStateTypes> = {
    namespaced: true,
    state: {
    } as any,
    mutations: {

    },
    actions: {
        //试卷回答详情
        async getExamAnswerDetail(state: any, data: any) {
            return new Promise<any>((resolve, reject) => {
                examAnswerDetail({
                    ...data
                }).then(res => {
                    resolve(res)
                }).catch(() => {
                    reject()
                })
            })
        },
        //活动详情
        async getActivityDetail(state: any, data: any) {
            console.log(data)
            return new Promise<any>((resolve, reject) => {
                activityDetail({
                    ...data
                }).then(res => {
                    resolve(res)
                }).catch(() => {
                    reject()
                })
            })
        },
        //试卷列表
        async getExamList(state: any, data: any) {
            return new Promise<any>((resolve, reject) => {
                examList({
                    ...data
                }).then(res => {
                    resolve(res)
                }).catch(() => {
                    reject()
                })
            })
        },
        //试卷详情
        async getExamDetail(state: any, data: any) {
            return new Promise<any>((resolve, reject) => {
                examDetail({
                    ...data
                }).then(res => {
                    resolve(res)
                }).catch(() => {
                    reject()
                })
            })
        }
    },
};

export default module;
